package com.lipaluma.xml.validator;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import com.lipaluma.field.validator.ValidatorFactory;

@XmlRootElement(name=XmlContainsValidator.CONTAINS)
@XmlAccessorType(XmlAccessType.FIELD)
public class XmlContainsValidator implements XmlValidator {
	public static final String CONTAINS = "contains";
	
	@XmlElement(name="value", required=true)
	private String[] values;
	@XmlAttribute(name="at-least-one")
	private boolean atLeastOne;

	@Override
	public String getFunctionValidation() {
		return ValidatorFactory.VALIDATION_CONTAINS_FUNCTION;
	}

	public String[] getValues() {
		return values;
	}
	public boolean isAtLeastOne() {
		return atLeastOne;
	}
}
